﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<BusinessComponents.ReservationMaster>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2></h2>

    <fieldset>
        <legend>Reservation Details</legend>
        
        <table id="tbDetails">
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.ReservationId)%>:</div></th>
                <td> <div class="display-field"><%: Model.ReservationId %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.CreatedDateTime )%>:</div></th>
                <td><div class="display-field"><%: Model.CreatedDateTime.ToString("dd MMM yyyy, HH:mm:ff") %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.UserName)%>:</div></th>

                <td><div class="display-field">
                <% if (User.IsInRole("admin"))
                   { 
                       var nm = Model.UserName;
                %>
                    <%: Html.ActionLink(nm, "Search", "Account", new { id = nm }, new { })%>
                <% 
                    }
                   else
                   { %>
                        <%: Model.UserName%>
                <% } %>
                </div></td>

            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.StartDate)%>:</div></th>
                <td><div class="display-field"><%: Model.StartDate.ToString("dd MMM yyyy") %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.EndDate)%>:</div></th>
                <td><div class="display-field"><%: Model.EndDate.ToString("dd MMM yyyy") %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.DayCount)%>:</div></th>
                <td><div class="display-field"><%: Model.DayCount %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.NoOfPax)%>:</div></th>
                <td><div class="display-field"><%: Model.NoOfPax %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.RoomTypeDesc)%>:</div></th>
                <td><div class="display-field"><%: Model.RoomTypeDesc%></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.RoomCount)%>:</div></th>
                <td><div class="display-field"><%: Model.RoomCount %></div></td>
            </tr>
            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.TotalCostInDollar)%>:</div></th>
                <td><div class="display-field"><%: Model.TotalCostInDollar%></div></td>
            </tr>

            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.StatusDesc )%>:</div></th>
                <td><div class="display-field"><%: Model.StatusDesc%></div></td>
            </tr>

            <% if (Model.IsCancelled == 1)
                { %>

                <tr>
                    <th><div class="display-label"><%: Html.LabelFor(model => model.CancelDateTime)%>:</div></th>
                    <td><div class="display-field"><%: String.Format("{0:dd MMM yyyy, HH:mm:ff}", Model.CancelDateTime) %></div></td>
                </tr>

            <% }
                else
                {%>

                <tr>
                    <th><div class="display-label"><%: Html.LabelFor(model => model.RoomList)%>:</div></th>
                    <td><div class="display-field"><%: Model.RoomList %></div></td>
                </tr>

            <% } %>

            <tr>
                <th><div class="display-label"><%: Html.LabelFor(model => model.Remarks)%>:</div></th>
                <td> <div class="display-field"><%: Model.Remarks %></div></td>
            </tr>
        </table>


    </fieldset>
    <p>

        <% if (Model.IsCancelled == 0)
           { %>
                <%: Html.ActionLink("Cancel", "Delete", new { id = Model.ReservationId })%> |
        <% } %>

        <% if (User.IsInRole("admin"))
           { %>
            <%: Html.ActionLink("Back to Search", "Search")%>
        <% 
            }
           else
           { %>
                <%: Html.ActionLink("Back", "Index")%>
        <% } %>
    </p>

</asp:Content>

